package com.chaoxing.service.impl;

import com.chaoxing.entity.CommonResult;
import com.chaoxing.entity.Course;
import com.chaoxing.entity.User;
import com.chaoxing.mapper.UserCourseMapper;
import com.chaoxing.service.UserCourseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserCourseServiceImpl implements UserCourseService {


    @Resource
    private UserCourseMapper userCourseMapper;

    @Override
    public List<Course> queryAllCoursesBySt(Integer id) {
        return userCourseMapper.queryAllCoursesBySt(id);
    }

    @Override
    public List<Integer> queryCourseIdByTe(Integer userid) {
        return userCourseMapper.queryCourseIdByTe(userid);
    }

    @Override
    public Course queryCourseBySt(Integer courseid) {
        return userCourseMapper.queryCourseBySt(courseid);
    }

    @Override
    public int insertCourseBySt(Integer userid, Integer courseid) {
        return userCourseMapper.insertCourseBySt(userid, courseid);
    }

    @Override
    public List<Integer> queryCourseIdBySt(Integer userid) {
        return userCourseMapper.queryCourseIdBySt(userid);
    }


    @Override
    public Course queryCourseByTe(Integer courseid) {
        return userCourseMapper.queryCourseByTe(courseid);
    }

    @Override
    public List<Course> queryAllCoursesByTe(Integer id) {
        return userCourseMapper.queryAllCoursesByTe(id);
    }

    @Override
    public List<User> queryAllStudentByTe(Integer courseid, int index, int pageSize) {
        return userCourseMapper.queryAllStudentByTe(courseid, index, pageSize);
    }


    @Override
    public int deleteStudentByAd(Integer courseid, Integer userid) {
        return userCourseMapper.deleteStudentByAd(courseid, userid);
    }

    @Override
    public int insertCourseByTe(Integer courseid, Integer userid) {
        return userCourseMapper.insertCourseByTe(courseid, userid);
    }

    @Override
    public int selectAll(Integer courseid) {
        return userCourseMapper.selectAll(courseid);
    }

    @Override
    public int deleteAll(Integer courseid) {
        return userCourseMapper.deleteAll(courseid);
    }

    @Override
    public int deleteCourseByAd(Integer id) {

        return userCourseMapper.deleteCourseByAd(id);
    }

    @Override
    public int deleteAllUsersByAd(List<Integer> list) {
        return userCourseMapper.deleteAllUsersByAd(list);
    }

    @Override
    public int deleteAllCoursesByAd(List<Integer> list) {
        return userCourseMapper.deleteAllCoursesByAd(list);
    }

    @Override
    public List<CommonResult> queryCoursesAndTeachByTe() {
        return userCourseMapper.queryCoursesAndTeachByTe();
    }
}
